package cn.itcast.service.message.impl;

import cn.itcast.dao.message.MessageDao;
import cn.itcast.domain.message.Message;
import cn.itcast.service.message.MessageService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private MessageDao messageDao;

    @Override
    public void save(Message message) {
        messageDao.save(message);
    }

    @Override
    public List<Message> findByMail(String email, Integer i) {
        return messageDao.findByMail(email,i);
    }

    @Override
    public void update(Message message) {
        messageDao.update(message);
    }

    @Override
    public void delete(String messageId) {
        messageDao.delete(messageId);
    }

    @Override
    public List<Message> findAll() {
        return messageDao.findAll();
    }

    @Override
    public List<Message> findByCompanyId(String companyId) {
        return messageDao.findByCompanyId(companyId);
    }

    @Override
    public List<Message> findByAllMail(String email) {
        return messageDao.findByAllMail(email);
    }

    @Override
    public List<Message> findAllNoRead(Integer i) {
        return messageDao.findAllNoRead(i);
    }

    @Override
    public List<Message> findByCompanyIdNoRead(String companyId, Integer i) {
        return messageDao.findByCompanyIdNoRead(companyId,i);
    }
}
